home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Queues
- BackColor = &H00C0FFC0&
- ClientHeight = 4605
- ClientLeft = 1575
- ClientTop = 1590
- ClientWidth = 6060
- Height = 5010
- Icon = 0
- Left = 1515
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 4605
- ScaleWidth = 6060
- Top = 1245
- Width = 6180
- Begin CommandButton Command1
- Caption = "OK"
- Default = -1 'True
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Left = 2640
- TabIndex = 0
- Top = 4080
- Width = 855
- End
- Begin PictureBox Warning
- BackColor = &H008080FF&
- Height = 495
- Index = 4
- Left = 360
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 5
- TabStop = 0 'False
- Top = 3480
- Width = 495
- End
- Begin PictureBox Warning
- BackColor = &H008080FF&
- Height = 495
- Index = 3
- Left = 360
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 4
- TabStop = 0 'False
- Top = 2760
- Width = 495
- End
- Begin PictureBox Warning
- BackColor = &H008080FF&
- Height = 495
- Index = 2
- Left = 360
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 3
- TabStop = 0 'False
- Top = 2040
- Width = 495
- End
- Begin PictureBox Warning
- BackColor = &H008080FF&
- Height = 495
- Index = 1
- Left = 360
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 2
- TabStop = 0 'False
- Top = 1320
- Width = 495
- End
- Begin PictureBox Warning
- BackColor = &H008080FF&
- Height = 495
- Index = 0
- Left = 360
- ScaleHeight = 465
- ScaleWidth = 465
- TabIndex = 1
- TabStop = 0 'False
- Top = 600
- Width = 495
- End
- Begin Label Jobs
- Alignment = 1 'Right Justify
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 4
- Left = 5160
- TabIndex = 23
- Top = 3600
- Width = 495
- End
- Begin Label Status
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 4
- Left = 3960
- TabIndex = 17
- Top = 3600
- Width = 975
- End
- Begin Label QueueName
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 4
- Left = 1200
- TabIndex = 11
- Top = 3600
- Width = 2535
- End
- Begin Label Jobs
- Alignment = 1 'Right Justify
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 3
- Left = 5160
- TabIndex = 22
- Top = 2880
- Width = 495
- End
- Begin Label Status
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 3
- Left = 3960
- TabIndex = 16
- Top = 2880
- Width = 975
- End
- Begin Label QueueName
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 3
- Left = 1200
- TabIndex = 10
- Top = 2880
- Width = 2535
- End
- Begin Label Jobs
- Alignment = 1 'Right Justify
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 2
- Left = 5160
- TabIndex = 21
- Top = 2160
- Width = 495
- End
- Begin Label Status
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 2
- Left = 3960
- TabIndex = 15
- Top = 2160
- Width = 975
- End
- Begin Label QueueName
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 2
- Left = 1200
- TabIndex = 9
- Top = 2160
- Width = 2535
- End
- Begin Label Jobs
- Alignment = 1 'Right Justify
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 1
- Left = 5160
- TabIndex = 20
- Top = 1440
- Width = 495
- End
- Begin Label Status
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 1
- Left = 3960
- TabIndex = 14
- Top = 1440
- Width = 975
- End
- Begin Label QueueName
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 1
- Left = 1200
- TabIndex = 8
- Top = 1440
- Width = 2535
- End
- Begin Label Jobs
- Alignment = 1 'Right Justify
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 0
- Left = 5160
- TabIndex = 19
- Top = 720
- Width = 495
- End
- Begin Label Status
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 0
- Left = 3960
- TabIndex = 13
- Top = 720
- Width = 975
- End
- Begin Label QueueName
- BackColor = &H00FFFFFF&
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FF0000&
- Height = 255
- Index = 0
- Left = 1200
- TabIndex = 7
- Top = 720
- Width = 2535
- End
- Begin Label Label13
- BackColor = &H00FF0000&
- Caption = "Jobs"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = -1 'True
- ForeColor = &H00FFFFFF&
- Height = 255
- Left = 5145
- TabIndex = 18
- Top = 240
- Width = 540
- End
- Begin Label Label7
- BackColor = &H00FF0000&
- Caption = "Status"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = -1 'True
- ForeColor = &H00FFFFFF&
- Height = 255
- Left = 3960
- TabIndex = 12
- Top = 240
- Width = 735
- End
- Begin Label Label1
- BackColor = &H00FF0000&
- Caption = "Queue"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = -1 'True
- ForeColor = &H00FFFFFF&
- Height = 255
- Left = 1200
- TabIndex = 6
- Top = 240
- Width = 735
- End
- Sub Command1_Click ()
- '*----------*
- 'close window
- '*----------*
- Unload Queues
- End Sub
- Sub Form_Load ()
- Static Share(49) As Share_Info
- Dim Queue As PRQJINFO
- Dim nEntries As Integer, nTotal As Integer, nNeeded As Integer
- Dim nResult As Integer, nQueue, nShare As Integer, nQueueWarning
- Dim szServer As String
- '*---------------------------------------------------*
- 'query specified server for a list of shared resources
- '*---------------------------------------------------*
- Queues.Caption = QWatch.Server.Text
- szServer = "\\" + QWatch.Server.Text + ""
- nResult = NetShareEnum(szServer, 2, Share(0), 2000, nEntries, nTotal)
- nQueue = 0
- For nShare = 0 To nEntries
- If Share(nShare).nType = 1 Then
- '*------------------------------------------------------*
- 'if shared resource is a print queue then get information
- '*------------------------------------------------------*
- nResult = DosPrintQGetInfo(szServer, Share(nShare).lpPath, 1, Queue, 115, nNeeded)
- '*------------------------------------------------------------*
- 'assign queue information to the elements in the control arrays
- '*------------------------------------------------------------*
- nQueueWarning = 0
- QueueName(nQueue).Caption = Share(nShare).szName
- Status(nQueue).Caption = "Idle"
- Jobs(nQueue).Caption = Str$(Queue.nJobs)
- '*-----------------------------------*
- 'determine warning level for the queue
- '*-----------------------------------*
- If Queue.nStatus = 64 Then
- nQueueWarning = 1
- Status(nQueue).Caption = "Paused"
- ElseIf Queue.nStatus = 32 Then
- nQueueWarning = 2
- Status(nQueue).Caption = "Offline"
- ElseIf Queue.nJobs Then
- If Queue.nJobs >= Val(QWatch.YellowLevel.Text) Then nQueueWarning = 1
- If Queue.nJobs >= Val(QWatch.RedLevel.Text) Then nQueueWarning = 2
- End If
- '*--------------------------------------------------*
- 'establish appropriate icon in the icon control array
- '*--------------------------------------------------*
- Select Case nQueueWarning
- Case 0
- Warning(nQueue).Picture = QWatch.Green.Picture
- Case 1
- Warning(nQueue).Picture = QWatch.Yellow.Picture
- Case 2
- Warning(nQueue).Picture = QWatch.Red.Picture
- End Select
- nQueue = nQueue + 1
- End If
- Next
- End Sub
-